package com.dingdang.controller.car_management;

import com.dingdang.data.Result;
import com.dingdang.em.ResultEnum;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import org.apache.rocketmq.spring.core.RocketMQTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("examinetion")
@Api("车辆审核功能接口")
public class examinetionController
{

    @Autowired
    private RocketMQTemplate rocketMQTemplate;


    @GetMapping
    @ApiImplicitParam(name = "carId",value = "车辆信息id",required = true,paramType = "query")
    public Result examine(@RequestParam("carId") Long carId)
    {
        try
        {
            rocketMQTemplate.convertAndSend("goods-topic",carId);
            return Result.response(ResultEnum.SUCCESS).setData("审核通过，发送消息");
        }
        catch (Exception e)
        {
            return Result.response(ResultEnum.ERROR).setData(e);
        }
    }


}
